<?php


namespace App\Constants;


use App\Entity\Order;

class OrderConst
{
    /**
     * 订单的最终状态 用户已完成 系统已完成 用户取消 退款取消 系统取消，其他为中间状态
     * @return array
     */
    public static function orderStatus()
    {
        return [
            Order::STATUS_INIT => '待付款',
            Order::STATUS_WAIT_DELIVER => '待发货',
            Order::STATUS_WAIT_SIGN => '待收货',
            Order::STATUS_FINISH => '用户完成',
            Order::STATUS_SYSTEM_FINISH => '系统完成',
            Order::STATUS_USER_CANCEL => '用户取消',
            Order::STATUS_REFUND_CANCEL => '退款取消',
            Order::STATUS_CANCEL => '系统取消'
        ];
    }

    public static function showOrderStatus()
    {
        return [
            Order::STATUS_INIT => [
                'value' => '待付款',
                'label' => Order::STATUS_INIT
            ],
            Order::STATUS_WAIT_DELIVER => [
                'value' => '待发货',
                'label' => Order::STATUS_WAIT_DELIVER
            ],
            Order::STATUS_WAIT_SIGN => [
                'value' => '待收货',
                'label' => Order::STATUS_WAIT_SIGN
            ],
            Order::STATUS_FINISH => [
                'value' => '已完成',
                'label' => Order::STATUS_FINISH
            ],
            Order::STATUS_SYSTEM_FINISH => [
                'value' => '已完成',
                'label' => Order::STATUS_FINISH
            ],
            Order::STATUS_USER_CANCEL => [
                'value' => '交易关闭',
                'label' => Order::STATUS_CANCEL
            ],
            Order::STATUS_REFUND_CANCEL => [
                'value' => '交易关闭',
                'label' => Order::STATUS_CANCEL
            ],
            Order::STATUS_CANCEL => [
                'value' => '交易关闭',
                'label' => Order::STATUS_CANCEL
            ]
        ];
    }

    public static function searchOrderStatus()
    {
        return [
            Order::STATUS_INIT => '待付款',
            Order::STATUS_WAIT_DELIVER => '待发货',
            Order::STATUS_WAIT_SIGN => '待收货',
            Order::STATUS_FINISH => '已完成',
            Order::STATUS_CANCEL => '已取消'
        ];
    }

    public static function searchOrderPayStatus()
    {
        return [
            Order::WAIT_PAY => '待支付',
            Order::PAID => '已支付',
            Order::REFUND_COMPLETE => '退款成功',
            Order::REFUND_WAIT => '退款审核中',
            Order::REFUNDING => '退款中',
            Order::PAY_OFF => '交易关闭',
            Order::PAY_COMPLETE => '交易完成'
        ];
    }

    /**
     * 支付的最终状态 退款成功 交易关闭 交易完成，其他为中间状态
     * @return array
     */
    public static function orderPayStatus()
    {
        return [
            Order::WAIT_PAY => '待支付',
            Order::PAID => '已支付',
            Order::REFUND_COMPLETE => '退款成功',
            Order::REFUND_WAIT => '待退款',
            Order::REFUNDING => '退款中',
            Order::PAY_OFF => '交易关闭',
            Order::PAY_COMPLETE => '交易完成'
        ];
    }
}